package DataStructures; 

/** 
 * Binary Tree class that will manage any trees we need. It is generic to 
 * allow for many parallel trees to be run concurrently without the need 
 * to write that many classes. 
 * @param <E> Type to manage in the tree. 
 */ 
public class Tree<E> { 
	/** 
	 * The root pointer of the tree. 
	 */ 
	private Tree<E> root; 
	 
	/** 
	 * Default constructor for the tree. 
	 */ 
	public Tree() 
	 
	/** 
	 * Inner class holds the tree nodes, each has time stamp and message id 
	 * to identify them as well as left and right references as required. 
	 * @param <E> 
	 */ 
	private class TreeNode<E> { 
		//nodes of the tree 
		private double dTimeStamp; 
		private int iMessageId; 
		private E eSearchType; 
		private Tree<E> tLeftNode, tRightNode; 
		 
		/** 
		*Default constructor 
		* 
		*The default constructor will do nothing.  It is just here for completeness. 
		*/ 
		public TreeNode() 
		 
		/** 
		 * Overloaded constructor that will take all the parameters and intialize a node. 
		 */ 
		public TreeNode(double ts, int msgId, E elem) 
		 
		/** 
		 * Add at the first available leaf a node while keeping balanced tree. 
		 */ 
		public void add(double ts, int msgId, E element) 
		 
		/** 
		 * Add under a given node. 
		 */ 
		public void insertAtNode(double ts, int msgid, E element, TreeNode<E> node) 
		 
		/** 
		 * Go to a particular node and delete it. Boolean returns based on success of deletion. 
		 */ 
		public void deleteNode(double ts, int msgId, E element, TreeNode<E> node) 
		 
		/** 
		 * Determines whether an element is contained in the tree, returns false unless it is found. 
		 * @param element Element looking for. 
		 * @return Boolean that is based on sucess. 
		 */ 
		public boolean contains(E element) 
		 
		/** 
		 * Finds a given element in a treenode and returns it. 
		 * @param element The element to look for. 
		 * @return The node itself will be returned. 
		 */ 
		public TreeNode<E> find() 
		 
		/** 
		 * Will compare the calling object with its two children and swap as necessary. 
		 */ 
		public swapSort() 
	} 
}
